package com.xh.bussiness.jingyou.service;

import com.alibaba.fastjson.JSONObject;
import com.xh.bussiness.tiku.bean.dto.QuestionDto;
import com.xh.bussiness.tiku.model.Question;
import com.xh.bussiness.tiku.bean.dto.QuestionSourceDto;
import com.xh.bussiness.tiku.model.QuestionType;
import com.xh.core.bean.XhPage;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菁优网用户 服务类
 * </p>
 *
 * @author JQM
 * @since 2019-11-11
 */
@Service
public interface IJYQuestionService{

	List<QuestionSourceDto> queryQuestionSource(String subject) throws Exception;

	List<QuestionType> queryQuestionType(String subject) throws Exception;

	List<QuestionDto> queryByImg(String imgPath) throws Exception;

	XhPage<QuestionDto> queryByParam(String subject, int tp, String p1, String p2, List<String> ids, String cate, int degree,
			Integer category, String region, String source, String year, int po, int pd, int onlyNos,
			XhPage<QuestionDto> page) throws Exception;
	
	XhPage<QuestionDto> queryByKey(String subject, String key, XhPage<QuestionDto> page) throws Exception;

	QuestionDto queryAnalyze(String subject, String id) throws Exception;

	List<QuestionDto> queryRecommond(String subject, String id, Integer count) throws Exception;

	List<QuestionDto> queryTitles(String subject, List<String> ids) throws Exception;

	List<Question> queryQuestions(String subject, List<String> ids) throws Exception;
	
	QuestionDto jyQues2QuestionDto(JSONObject json);

	/**
	 * 下载学生错题本
	 * @param subject 学科
	 * @param id 试题标识
	 * @param method 试题解析 [1: 分析；2：解答；4：点评；8：考点；16：专题；32：考点卡片；64：试题来源]
	 * @param flag 下载文件格式：1：DOC（默认）；2：DOCX
	 * @return 试题WORD数据
	 */
	byte[] downloadQuestion(String subject,String id,Integer method, Integer flag) throws Exception;

}
